package cn.com.stums.service.common;

import org.apache.log4j.Logger;

import cn.com.stums.dao.merchant.AreaDao;

public class MerchantServiceImp implements MerchantService{
	private AreaDao areaDao;
	private static Logger logger = Logger.getLogger(MerchantServiceImp.class);
	
	public boolean deleteArea(String[] idArray)throws RuntimeException{
		boolean result = true;
		if(idArray.length <= 0 || idArray == null)
		{
			result = false;
			return result;
		}
		try
		{
			for(String id:idArray)
			{
				if(!areaDao.deleteArea(Integer.parseInt(id))){
					throw new RuntimeException();
				}
			}
		}catch(Exception e){
			e.printStackTrace();
			logger.error(e.toString());
			throw new RuntimeException(e.toString());
		}
		return result;
	}

	public AreaDao getAreaDao() {
		return areaDao;
	}
	public void setAreaDao(AreaDao areaDao) {
		this.areaDao = areaDao;
	}
	
}
